fix: repair milestone-escrow CI build and tests - #429
Merged
Conversation
- annotate test modules with #[cfg(test)] so the wasm build succeeds without dev-dependencies - make setup_funded_escrow pub(crate) and fix test imports so sibling test modules can use it (Address::generate requires testutils trait) - remove redundant admin.require_auth() before require_admin in admin_override_cancel_refund; require_admin already performs the signature check, and env-host 22.1.3 rejects the double auth with Error(Auth, ExistingValue) - fund a terminal-state cancel test through the zero-balance boundary guard in cancel_escrow so its invalid-amount assertion stays intact - add missing admin_override_cancel_tests snapshot files (untracked, would otherwise fail CI on a fresh checkout)
|
Hey @iexwr! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
godamongstmen897
added a commit
to Jessepriase/escrow-contract
that referenced
this pull request
Sep 1, 2026
…sed-milestone case
Two things kept this from compiling and passing.
The emergency-pause guard read DataKey::EmergencyPaused, which does not
exist:
error[E0599]: no variant or associated item named `EmergencyPaused`
found for enum `DataKey`
This contract has two separate pause flags -- DataKey::Ep for the
emergency pause (set by emergency_pause_admin_override, read by
ensure_not_paused) and DataKey::Paused for admin_pause_escrow. The
comment and the Error::Paused return both describe the emergency one,
so the guard now reads DataKey::Ep. The branch's own CancelLock check
is left as-is, since it returns EscrowLocked rather than the error
ensure_not_paused would give.
The new test test_cancel_escrow_all_milestones_released_still_succeeds
then failed. Its premise -- "no business rule blocks it" -- is no longer
true: cancel_escrow rejects a zero contract balance with InvalidAmount,
and releasing the only milestone empties the contract, so the balance
guard fired rather than anything to do with milestone status.
The test now mints 1 stroop back to the contract before cancelling, the
same workaround Goldii-locks#429 used for the same guard. That keeps it testing what
it claims -- that Released milestones do not themselves block a cancel --
instead of re-testing the balance guard.
538 tests passing / WASM release build OK
godamongstmen897
added a commit
to Esbeevybz/escrow-contract
that referenced
this pull request
Sep 1, 2026
The conflict was just a module declaration; it now sits under #[cfg(test)] alongside the others, matching what Goldii-locks#429 established. Two compile fixes in the new suite: - setup_funded_escrow was not in scope. Imported from crate::test, the same way admin_override_cancel_tests.rs does it. - DataKey::YieldRateBps does not exist. admin_set_yield_rate persists the rate as the yield_rate field of the YieldConfig entry under DataKey::YieldConfig, so read_yield_rate reads that instead. None still means "never written", which is what the no-mutation cases want. Three of the new tests then failed, and they were right to. They pause with emergency_pause and expect admin_set_yield_rate to return Paused, but it called only assert_not_paused, which reads DataKey::Paused -- the flag admin_pause_escrow sets. The emergency pause is a separate, stronger freeze recorded under DataKey::Ep, and nothing was checking it here, so a yield-rate change went straight through an emergency pause while the weaker admin pause blocked it. admin_set_yield_rate now rejects under either flag. That is the hardening this PR set out to add; the tests had simply reached for the pause that was not wired up. No existing test asserted the old behaviour. 558 tests passing / WASM release build OK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repairs the repo-wide CI failure so the test suite builds and runs again on a clean checkout.
Root causes fixed
#[cfg(test)]incontracts/milestone-escrow/src/lib.rs. Without it, dev-dependencies were referenced during thewasm32build, failing CI compilation.setup_funded_escrowwas private andAddress::generateneededsoroban_sdk::testutils::Address, soadmin_override_cancel_tests.rscould not compile as a sibling module.admin_override_cancel_refund: calledadmin.require_auth()thenrequire_admin(which also callsadmin.require_auth()). env-host 22.1.3 rejects the nested frame withError(Auth, ExistingValue), failing 8 tests.admin_override_cancel_tests(untracked in main), which fail CI on a fresh checkout.Validation
cargo testformilestone-escrow: 463 passed, 0 failed.